import * as THREE from 'three'
import Experience from '../General/Experience'
import Resource from '../Utils/Resource'

export default class Environment {
  experience!: Experience
  scene!: THREE.Scene
  resource!: Resource
  sunLight!: THREE.DirectionalLight
  constructor() {
    this.experience = new Experience()
    const { scene, resource } = this.experience
    this.scene = scene
    this.resource = resource
    this.setSunlight()
  }
  setSunlight() {
    this.sunLight = new THREE.DirectionalLight(0x65c2ff, 3)
    this.sunLight.castShadow = true
    this.sunLight.shadow.camera.far = 20
    this.sunLight.shadow.mapSize.set(2048, 2048)
    this.sunLight.shadow.normalBias = 0.05
    this.sunLight.position.set(-1.5, 7, 3)
    this.scene.add(this.sunLight)
  }
}
